package com.zengqingfa.designpattern.behavior.template.callback;

/**
 *
 * @fileName: Client
 * @author: zengqf3
 * @date: 2021-4-9 15:24
 * @description:
 */
public class Client {

    public static void main(String[] args) {
        // AClass a = new AClass();
        // a.process(new ICallBack() {
        //     @Override
        //     public void callBack() {
        //         System.out.println("call back ....");
        //     }
        // });

        Template template = new Template();
        template.templateMethod(new ConcreteCallBack1());
        System.out.println("=====================");
        template.templateMethod(new ConcreteCallBack2());
        System.out.println("=====================");
        //匿名内部类
        template.templateMethod(new ICallBack() {
            @Override
            public void callBack() {
                System.out.println("匿名内部类实现了方法");
            }
        });
    }
}
